/*
 * 	GPIO.h
 *
 *  Created on: 2020年7月31日
 *      Author: Jiarun
 */

#ifndef __USER_GPIO_H
#define __USER_GPIO_H

/* ----------------------------------Includes --------------------------------*/
#include "stm32f1xx_hal.h"
#include "stm32f1xx_hal_gpio.h"


class GPIO
{
public:
		GPIO(GPIO_TypeDef* Port, uint16_t Pin, uint32_t Mode, uint32_t Pull = GPIO_PULLUP);
		GPIO();
		~GPIO();

    void operator<<(char level);
    char operator>>(uint8_t &level);
		GPIO operator=(GPIO port);


    GPIO_TypeDef* Port;
    GPIO_InitTypeDef GPIO_InitStruct;
protected:
    void GPIO_CLK_ENABLE(uint32_t RCC_APB2ENR_IOPEN);
};


#ifdef __cplusplus
 extern "C" {
#endif
	 

#ifdef __cplusplus
}
#endif

#endif /* GPIO_H */
